package com.howcan.api;

import android.os.Parcel;
import android.os.Parcelable;

public class Region implements Parcelable {
	
	private int id;
	private double lat;
	private double lng;
	private String name;
	private int parentId;

	private Region()
	{
	}

	public Region(int i, String s, int j)
	{
		id = i;
		name = s;
		parentId = j;
	}

	private Region(Parcel parcel)
	{
		id = parcel.readInt();
		name = parcel.readString();
		parentId = parcel.readInt();
	}

	Region(Parcel parcel, Region region)
	{
		this(parcel);
	}

	Region(Region region)
	{
		this();
	}

	public int describeContents()
	{
		return 0;
	}

	public boolean equals(Object obj)
	{
		boolean flag;
		if (obj != this && (!(obj instanceof Region) || ((Region)obj).id != id))
			flag = false;
		else
			flag = true;
		return flag;
	}

	public double getLat()
	{
		return lat;
	}

	public double getLng()
	{
		return lng;
	}

	public int hashCode()
	{
		return id;
	}

	public int id()
	{
		return id;
	}

	public String name()
	{
		return name;
	}

	public int parentId()
	{
		return parentId;
	}

	public String toString()
	{
		return (new StringBuilder(String.valueOf(id))).append(" : ").append(name).toString();
	}

	public void writeToParcel(Parcel parcel, int i)
	{
		parcel.writeInt(id);
		parcel.writeString(name);
		parcel.writeInt(parentId);
	}

}
